Skip to content

Add native support for deletion protection - #440

Merged
GrahamCampbell merged 5 commits into
4.xfrom
feature/deletion-protection
Aug 23, 2026
Merged

Add native support for deletion protection#440
GrahamCampbell merged 5 commits into
4.xfrom
feature/deletion-protection

Conversation

@GrahamCampbell

Copy link
Copy Markdown
Contributor

This supersedes #418 and keeps its four commits from @mnapoli as they were, rebased onto 4.x, followed by one commit with the changes that came out of review.

Deletion protection now lives in its own internal plugin, mirroring provider.pruneFunctionVersions: it validates the configuration before the deploy and sets the stack's termination protection on after:deploy:deploy, which covers every terminal deploy path, including deploys skipped because nothing changed, while leaving rollback and deploy function alone, so those commands no longer need cloudformation:UpdateTerminationProtection. Values that slip past schema validation under configValidationMode: warn or off fail with INVALID_DELETION_PROTECTION_CONFIG before anything is uploaded instead of silently disabling protection, an SDK failure after an otherwise successful stack update is reported as such, and a first change-set deploy that ends with an empty change set no longer protects a stack left in REVIEW_IN_PROGRESS.

The remove guard warns and continues when DescribeStacks is denied, its message covers the stages form and the AWS CLI escape hatch, and the ECR repository probe runs concurrently again. The docs spell out that unlisted stages are actively unprotected, which differs from the plugin this replaces, plus the IAM permissions, the first-deploy window and the deploy --package caveat. The schema moved to a named awsDeletionProtection definition and the unrelated type reflows were dropped.

@mnapoli mnapoli left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice thanks!

@GrahamCampbell
GrahamCampbell force-pushed the feature/deletion-protection branch from 9119fc2 to 815b7c5 Compare August 23, 2026 20:12
@GrahamCampbell
GrahamCampbell merged commit 818c54e into 4.x Aug 23, 2026
8 checks passed
@GrahamCampbell
GrahamCampbell deleted the feature/deletion-protection branch August 23, 2026 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants